<template>
  <!-- 公共头部 -->
  <div class="deal_header">
    <!-- 左 -->
    <div class="header_left" @click="goPage('/market/kline/menu')">
      <img src="@/assets/deal/menu_icon.png" alt="" />
      <span>BTC/USDT</span>
      <span class="add_number">+0.15%</span>
    </div>
    <!-- 右 -->
    <div class="header_right" @click="goPage('/market/kline')">
      <img src="@/assets/deal/data_icon.png" alt="" />
    </div>
  </div>
</template>

<script setup lang="ts">
import { defineProps, defineEmits } from "vue";
import { useRouter } from "vue-router";

// 获取路由信息
const router = useRouter();
// 获取父组件传递的属性和方法
defineProps(["title", "isBack"]);
const emits = defineEmits(["back", "records"]);

// 跳转指定页
const goPage = (path: string) => {
  router.push(path)
};
</script>

<style lang="scss" scoped>
.deal_header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  display: flex;
  padding: 10px;
  align-items: center;
  justify-content: space-between;
  background-color: #030303;
  .header_left,
  .header_right {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
  }
  .header_left {
    span {
      margin-left: 5px;
    }
    .add_number {
        font-size: 14px;
      }
  }
}
</style>
